/**
 * Besturing
 *
 * meer uitleg in motorSturing.cpp
 *
 * @author Jasper Nevens <jasper@nevensit.be>
 * @date    24/02/11
 */
#ifndef BESTURING_H_
#define	BESTURING_H_

#include <string>
#include <math.h>
#include "thread.h"
#include "motors.h"
#include "muis.h"
#include "movement.h"
#define MAXMAT	4

//manoevre ID's
#define NTR 0 //in neutraal : stilstaan //best 0 laten //TODO amount == tijd?
#define FWD 1 //voorwaarts
#define BWD 2 //achterwaarts
#define TNL 3 //turn left //CCW
#define TNR 4 //turn right//CW


// MotorSturing class definition
class Besturing : public Thread
{
	public:
		// constructor	
		Besturing(void);
		~Besturing(void);
		
		void 	execute();	
		void 	goTo(int,int,float);
		void	setLocation(int,int,float);
		bool	isBusy();
		bool	isReady();
		bool 	MatrixMultiply(float A[MAXMAT][MAXMAT],float B[MAXMAT][MAXMAT],float R[MAXMAT][MAXMAT],int M,int L,int N);
	private:
		Motors 	*motors;
		Muis 	*muisL;
		Muis 	*muisR;
		bool	ready,busy;
		// current location
		int		x,y;
		float	angle;
		// target parameters
		int		tx,ty;
		float	tangle;
		// static vars
		float   posMat[3][4];
}; 

#endif /* BESTURING_H_ */
